package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.framework.dto.TabDto;
import com.molichuxing.services.business.dto.response.StatisticsAssetOrderDto;
import com.molichuxing.services.infrastructure.bean.StatisticsAssetBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 资产统计
 * </p>
 *
 * @author zhaopenghui
 * @since 2020 -08-25
 */
public interface StatisticsAssetMapper extends RootMapper<StatisticsAssetBean> {

    /**
     * 获取统计数量
     *
     * @return
     */
    List<TabDto> getCountByUseType(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 获取统计数量
     *
     * @return
     */
    List<TabDto> getCountByRentalType(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 获取统计数量
     *
     * @return
     */
    List<TabDto> getCountByRollbackOverdueType(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 获取统计数量
     *
     * @return
     */
    List<TabDto> getCountByInStockType(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 获取列表
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<StatisticsAssetBean> getList(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 删除数据
     *
     * @return
     */
    int deleteAsset();

    /**
     * 报废车：专属里程退租车辆标记为报废的车辆
     *
     * @return the scrapped car statistics asset order
     */
    List<StatisticsAssetOrderDto> getScrappedCarStatisticsAssetOrder();

    /**
     * 丢失车：专属里程退租车辆标记为丢失的车辆；
     *
     * @return the lost car statistics asset order
     */
    List<StatisticsAssetOrderDto> getLostCarStatisticsAssetOrder();

    /**
     * 待收车：专属里程逾期后走协商退租未收车或收车失败的车辆数；
     *
     * @return the waiting car statistics asset order dto
     */
    List<StatisticsAssetOrderDto> getWaitingCarStatisticsAssetOrderDto();

    /**
     * 诉讼中：专属里程订单退租车辆未收车或收车失败且诉讼中的车辆数；
     *
     * @return the lawsuit car statistics asset order dto
     */
    List<StatisticsAssetOrderDto> getLawsuitCarStatisticsAssetOrderDto();

    /**
     * 批售：新车标记为已出售的车辆数；
     *
     * @return batch sale car statistics asset order dto
     */
    List<StatisticsAssetOrderDto> getBatchSaleCarStatisticsAssetOrderDto();

    /**
     * 实际在库：未做过任何业务在库的车辆数；
     *
     * @return in car store statistics asset order dto
     */
    List<StatisticsAssetOrderDto> getInCarStoreStatisticsAssetOrderDto();

    /**
     * 公务车：标记为公务车的车辆数；
     *
     * @return list
     */
    List<StatisticsAssetOrderDto> geOfficialCarStatisticsAssetOrderDto();

    /**
     * 批量添加
     *
     * @param beanList the bean list
     */
    void saveBatchStatisticsAsset(@Param("beanList") List<StatisticsAssetBean> beanList);
}